import {useState} from "react";
import {Video, View} from "@tarojs/components";
import {useLoad} from '@tarojs/taro'
import './index.scss'

export default function Index() {

  const [videoUrl, setVideoUrl] = useState<string>('');

  useLoad((param) => {
    console.log('查看视频页面加载', param)
    setVideoUrl(param.url)
  })

  return (
    <View className='video-container'>
      <Video
        id='video'
        src={videoUrl}
        initialTime={0}
        controls
        autoplay={false}
        loop
        muted={false}
        className='video'
      />
    </View>
  )
}
